package replace.temp.with.query;

/**
 * Created by Administrator on 2018/1/25.
 */
public class Test {

    private double quantity;
    private double itemPrice;

    double test() {
        double basePrice = quantity * itemPrice;
        if (basePrice > 1000) {
            return basePrice * 0.95;
        } else {
            return basePrice * 0.98;
        }
    }

    double testRF() {
        if (basePrice() > 1000) {
            return basePrice() * 0.95;
        } else {
            return basePrice() * 0.98;
        }
    }

    double basePrice() {
        return quantity * itemPrice;
    }

}
